#include "stddef.h"

/**
The structure gives a facility to save some information in form of cyclic buffer  
<---[head][][][tail]<--^
!______________________!

The unit of information for store is presented like a pointer.

Short description :
head - offset of first block information
tail - offset of last block information
size - size of buffer (blocks quantity)
unit_size - size of block information (will be needed to allocate buffer memory)
*/

typedef struct CBUFFER {
	unsigned char 	head;
	unsigned char 	tail;
	size_t			size;
	size_t			unit_size;
	void 			*pcbuffer;
} CBUFFER;

/**
Interface functions to write and read from/to cyclic buffer.
*/
void cb_write (CBUFFER *pcb, const void *pd);

void *cb_read (CBUFFER *pcb);

//size_t getSize (CBUFFER *pcb);
